import 'package:core_foundation_example/pages/page_home.dart';
import 'package:flutter/material.dart';

class PageWelcome extends StatefulWidget {
  static const rName = "/";
  @override
  _PageWelcomeState createState() => _PageWelcomeState();
}

class _PageWelcomeState extends State<PageWelcome> {
  bool isLoad = false;
  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    if (isLoad) {
     return;
    }
    isLoad = true;
    debugPrint("in didChangeDependencies");

    Future.delayed(
        Duration(seconds: 5), ()=> Navigator.push(context, MaterialPageRoute(builder: (context) => PageHome())));//
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text("欢迎页面,5秒后跳转到主页"),
      ),
    );
  }
}
